//app.js
import { config } from "./config"
App({
  onLaunch: function (options) {
    console.log(options)
    if (options.query) {
      this.globalData.uid = options.query.uid
    }
    wx.getSystemInfo({
      success: res => {
        //导航高度
        this.globalData.navHeight = res.statusBarHeight + 56;
        console.log(res.statusBarHeight + 60)
      }, fail(err) {
        console.log(err);
      }
    })
    wx.request({
      url: `https://www.pdjlixiang.com/cip-rest/user/thirdPartyLogin`,
      method: "post",
      data:{
        userName:'thirdParty51',
        passWord:'thirdParty51'
      },
      header: {
        'content-type':'application/x-www-form-urlencoded;charset=utf-8'
      },
      success: (res) => {
        this.globalData.token = res.data.data.token
      }
    })
    wx.request({
      url: `${config.api_blink_url}/token.json?time=${new Date().getTime()}`,
      method: "get",
      header: {
        'content-type': 'application/json'
      },
      success: (res) => {
        this.globalData.easyArToken = res.data.token
      }
    })
  },
  globalData: {
    userInfo: null,
    navHeight: 0,
    token:'',
    uid:'',
    easyArToken:''
  }
})